//
//  AutoShowLabel.m
//  Fitness War
//
//  Created by zhu on 12-3-18.
//  Copyright 2012年 __MyCompanyName__. All rights reserved.
//走马灯类

#import "AutoShowLabel.h"


@implementation AutoShowLabel

- (void) dealloc
{
    [super dealloc];
}

- (id)init
{
    [super init];
    if (self)
    {
        self.center = CGPointMake(100, 0);
        self.textAlignment = UITextAlignmentLeft;
        self.text = @"";
        self.backgroundColor = [UIColor clearColor];
        self.textColor = [UIColor orangeColor];
        [NSTimer scheduledTimerWithTimeInterval:0.01f
                                         target:self 
                                       selector:@selector(moveText) 
                                       userInfo:nil repeats:YES];
    }
    
    return self;
   
}


- (void)moveText
{
    int xValue = self.center.x;
    int yValue = self.center.y;
    xValue-=1;
    if (xValue < -self.frame.size.width) 
    {
        xValue = self.frame.size.width;
    }
    
    self.center = CGPointMake(xValue, yValue);
    
}



@end
